﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wcf_Medical;
using Data;

namespace WPFInterface.DataAccess
{
    public class Users
    {
        ///// <summary>
        ///// liste des utilisateurs
        ///// </summary>
        //private List<Model.User> _listUser = null;

        ///// <summary>
        ///// construteur
        ///// </summary>
        //public Users()
        //{
        //    //init variables
        //    _listUser = new List<WPFInterface.Model.User>();
        //    _
        //}

        ///// <summary>
        ///// valide ou non l'authentification d'un utilisateur
        ///// </summary>
        ///// <param name="name">login du user</param>
        ///// <param name="pwd">password du user</param>
        ///// <returns>vrai si login/psswd bon sinon faux</returns>
        //public bool TestUser(string name, string pwd)
        //{
        //    return _listUser.Where(x => x.Name == name && x.Pwd == pwd).Any();
        //}

        /// <summary>
        /// liste des utilisateurs
        /// </summary>
        private List<Dbo.User> _listUser = null;

        /// <summary>
        /// construteur
        /// </summary>
        public Users()
        {
            //ServiceUser users = new ServiceUser();
            ////init variables
            //_listUser = users.GetListUser();

            //Data.User users = new Data.User();
            //_listUser = users.CreateListUser();
        }

        /// <summary>
        /// valide ou non l'authentification d'un utilisateur
        /// </summary>
        /// <param name="name">login du user</param>
        /// <param name="pwd">password du user</param>
        /// <returns>vrai si login/psswd bon sinon faux</returns>
        public bool TestUser(string name, string pwd)
        {
            return _listUser.Where(x => x.Name == name && x.Pwd == pwd).Any();
        }
    }
}
